#coding=utf-8
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'stockcn.settings'

from stockcrawler import get_codes
from data.models import get_or_create_stock, get_stock_by_code, update_edays
import time
for c in get_codes('sh'):
    s = get_or_create_stock(c)
    s = get_stock_by_code(c)
    update_edays(s)
    time.sleep(1)
    
